package org.qingke.mail.backend.controller;

import java.util.Date;

import org.qingke.mail.backend.service.UserService;
import org.qingke.mail.common.Response;
import org.qingke.mail.domain.TbUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/insert")
	public Response insert(){
		String data = String.valueOf(System.currentTimeMillis());
		TbUser user = new TbUser();
		user.setUsername(data);
		user.setPassword(data);
		user.setEmail(data+ "@163.com");
		user.setCreated(new Date());
		user.setUpdated(new Date());
		
		return userService.insert(user);
		
	}

}
